/**
 * 
 * @authors supmain (mtingfeng@gmail.com)
 * @date    2014-08-13 10:16:10
 * @update  2014-08-13 10:16:10
 * @for webapp.html
 * @version $Id$
 */
var BST = BST || {};
BST.joinus = {
    init:function(){
        var that = this;
    },
    nTabs:function(thisObj,Num){
        if(thisObj.className == "on")return;
        var tabObj = thisObj.parentNode.id;
        var tabList = document.getElementById(tabObj).getElementsByTagName("li");
        for(i=0; i <tabList.length; i++) {
            if (Num == 1) {
                $("#imgPage").hide();
            } else {
                $("#imgPage").show();
            }
          
          if (i == Num)
          {
           thisObj.className = "active"; 
              document.getElementById(tabObj+"_Content"+i).style.display = "block";
          }else{
           tabList[i].className = "sta"; 
           document.getElementById(tabObj+"_Content"+i).style.display = "none";
          }
        }
    }
};
$(function(){
    BST.joinus.init();
});

function DrawImage(ImgD,iwidth,iheight){
    var image=new Image();
    image.src=ImgD.src;
    if(image.width>0 && image.height>0){
        flag=true;
        if(image.width/image.height>= iwidth/iheight){
            if(image.width>iwidth){ 
                ImgD.width=iwidth;
                ImgD.height=(image.height*iwidth)/image.width;
            }else{
                ImgD.width=image.width; 
                ImgD.height=image.height;
            }
        }else{
            if(image.height>iheight){ 
                ImgD.height=iheight;
                ImgD.width=(image.width*iheight)/image.height; 
            }else{
                ImgD.width=image.width; 
                ImgD.height=image.height;
            }
        }
    }
}  

